package com.core.dao;

import com.common.ibatis.BaseDao;
import com.core.entity.ActivitySource;
import com.core.entity.ActivitySourceExample;
import java.util.List;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

public class ActivitySourceDAOImpl extends BaseDao implements ActivitySourceDAO {

    public ActivitySourceDAOImpl() {
        super();
    }

   
    public void insert(ActivitySource record) {
        getSqlMapClientTemplate().insert("activity_source.abatorgenerated_insert", record);
    }

    
    public int updateByPrimaryKey(ActivitySource record) {
        int rows = getSqlMapClientTemplate().update("activity_source.abatorgenerated_updateByPrimaryKey", record);
        return rows;
    }

    public int updateByPrimaryKeySelective(ActivitySource record) {
        int rows = getSqlMapClientTemplate().update("activity_source.abatorgenerated_updateByPrimaryKeySelective", record);
        return rows;
    }

    
    public List selectByExample(ActivitySourceExample example) {
        List list = getSqlMapClientTemplate().queryForList("activity_source.abatorgenerated_selectByExample", example);
        return list;
    }

    
    public ActivitySource selectByPrimaryKey(Integer id) {
        ActivitySource key = new ActivitySource();
        key.setId(id);
        ActivitySource record = (ActivitySource) getSqlMapClientTemplate().queryForObject("activity_source.abatorgenerated_selectByPrimaryKey", key);
        return record;
    }

   
    public int deleteByExample(ActivitySourceExample example) {
        int rows = getSqlMapClientTemplate().delete("activity_source.abatorgenerated_deleteByExample", example);
        return rows;
    }

   
    public int deleteByPrimaryKey(Integer id) {
        ActivitySource key = new ActivitySource();
        key.setId(id);
        int rows = getSqlMapClientTemplate().delete("activity_source.abatorgenerated_deleteByPrimaryKey", key);
        return rows;
    }

    
    public int countByExample(ActivitySourceExample example) {
        Integer count = (Integer)  getSqlMapClientTemplate().queryForObject("activity_source.abatorgenerated_countByExample", example);
        return count.intValue();
    }

    
    public int updateByExampleSelective(ActivitySource record, ActivitySourceExample example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("activity_source.abatorgenerated_updateByExampleSelective", parms);
        return rows;
    }

   
    public int updateByExample(ActivitySource record, ActivitySourceExample example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("activity_source.abatorgenerated_updateByExample", parms);
        return rows;
    }

    
    private static class UpdateByExampleParms extends ActivitySourceExample {
        private Object record;

        public UpdateByExampleParms(Object record, ActivitySourceExample example) {
            super(example);
            this.record = record;
        }

        public Object getRecord() {
            return record;
        }
    }


}